import Vuex from 'vuex';
import Vue from 'vue';

Vue.use(Vuex);

const store = new Vuex.Store({
    state: {
        config: {
            poster: '', // 生成海报的气泡文字
            messageTips: '', //留言列表顶部的提示文字
            explain: '', //联系客服的文字说明
            weixinhao: '', // 联系客服的文字微信号
            miniProgramName: '', //关联的小程序名称
            miniProgramLink: '', //关联的小程序链接
            payPrice: '',
            iosPayFlag: '',
            andriodPayFlag: '',
            payBtnText: '',
            releaseFlag: false
        },
    },
    mutations: {
        setConfig(state, list) {
            state.config = {
                poster: list[0].paramValue,
                messageTips: list[1].paramValue,
                explain: list[2].paramValue,
                weixinhao: list[3].paramValue,
                miniProgramName: list[4].paramValue,
                miniProgramLink: list[5].paramValue,
                payPrice: list[8].paramValue,
                iosPayFlag: list[6].paramValue,
                andriodPayFlag: list[7].paramValue,
                payBtnText: list[9].paramValue,
                releaseFlag: list[11].paramValue
            };
            console.log(state);
        },
    },
    actions: {},
});

export default store;
